package com.mynetwork.activity;


import com.mynetwork.utils.Size;

import android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.ContextThemeWrapper;

public class ActivityBase extends Activity{
	private static final String TAG = "ActivityBase";
	
	public static final int DIALOG_NETWORK_FAIL = 10000;
	protected boolean is600dp = false;
	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Size.InitScreenSize(this);
        if (Size.Density > 1.3 && Size.Density < 1.4) {
        	if ((Size.DisplayWidth == 800 && Size.DisplayHeight == 1280) ||
        			(Size.DisplayWidth == 1280 && Size.DisplayHeight == 800))
            	is600dp = true;
        }
	}
	
	@Override
	protected Dialog onCreateDialog(int id) {
		if (id == ActivityBase.DIALOG_NETWORK_FAIL) {
			return getNetworkFailDialog();
		}
		return super.onCreateDialog(id);
	}
	
	protected Dialog mNetworkFailDialog;
	public Dialog getNetworkFailDialog() {
		AlertDialog.Builder bulder = new AlertDialog.Builder(new ContextThemeWrapper(this, android.R.style.Theme_Holo_Dialog))
		.setTitle("알림")
		.setMessage("네트워크 연결이 끊긴 상태")
		.setCancelable(false)
		.setPositiveButton(getResources().getText(R.string.ok),new DialogInterface.OnClickListener(){
			@Override
			public void onClick(DialogInterface arg0, int arg1) {
				// TODO Auto-generated method stub
				
			}
		});
		mNetworkFailDialog = bulder.create();
		return mNetworkFailDialog;
	}
}
